<?php
namespace Home\Controller;
use Think\Controller;

/**
 * 返回消息类
 * 
 */
class IndexController extends Controller {

	 

    public function index(){
    	//echo "hi";
    	/*$openid = 'tets1';
    	$keyword = '摆渡人';
    	//$content = '说asdasdnjasdnkasndjkasndkjasndjkasn如果你很忙 你就先忙吧 那么等你忙完了 我们继续做朋友好吗？';
    	$content = '说真的我也不知道跟你说些什么好 只是想告诉你 我想你很久很久 每天晚上 梦里总有你 如果你很忙 你就先忙吧 那么等你忙完了 我们继续做朋友好吗？';
     //$this->display();
     $ch = curl_init();////初始化一个curl对象
     $timeout = 5;
     curl_setopt ($ch, CURLOPT_URL, 'http://localhost/index.php/Home/ReviceMsg/ResponseMsg?openid='.$openid.'&keyword='.$keyword.'&content='.$content); //设置你需要抓取的URL
     curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); //设置是将结果保存到字符串中还是输出到屏幕上，1表示将结果保存到字符串
     curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); //为了应对目标服务器的过载
     $file_contents = curl_exec($ch);
     curl_close($ch);
     echo $file_contents;*/
   
     /*$getInfo['openid'] = 'wilson';
     //$getInfo['keyword'] = '343543242341`dsfsd42';
     $getInfo['content'] = ' ycysd asdhasdasden weasdasdn rou  w3asdasd23445i ';
     //$getInfo['ioiui'] = 'woai34ni';
     $test = new EntranceController();
      //$test = D('User');
     $test->Content($getInfo);*/
     /*if($test->Ferryman($getInfo)){
     	echo "success";
     }else{
     	echo "false";
     }*/

      $getInfo['openid'] = 'omvjis3LAktzHIS_Etcv';
      //$getInfo['content'] = 'chou ke shi wo hen wen rou  w3asdasdasdasdsad4325656565623664782634823445i ';
      $test = D('User');
      echo $test->checksendOpenid($getInfo['openid']);
       //echo "hello world";

    }
    public function test(){
    	$getInfo=I('get.');
		//echo "$openid".$getInfo['keyword'];
		$content = "每个人只能分享一个烦恼哦~".$getInfo['content'];
			$Transmit = new TransmitController();
            $Transmit->transmitText($getInfo['openid'],$content);
	}

    public function errorpage(){
		header("HTTP/1.0 404 Not Found");//使HTTP返回404状态码
		//$this->display("public/404");
		$this->display();
		
		exit();
	}

	
    
}